package com.javatest;

/**
 * @author LL
 * 给出 exR1(6) 的返回值,使用递归方式
 * @create 2021-01-13 11:30
 */
public class Subject28 {

    public static String exR1(int n){
        if(n <= 0){
            return "";
        }else{
            String s = exR1(n - 3) + n + exR1(n - 2) + n;
            return s;
        }
    }

    public static String exR2(int n){
        String s = exR2(n - 3) + n + exR2(n - 2) + n;
        if(n <= 0){
            return "";
        }
        return s;
    }



    public static void main(String[] args) {
        //System.out.println(exR2(4));

    }

}
